﻿<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>PlaytimeEdit</title>
    <style type="text/css">
        h1
        {
            font-family: MyriadPro-Semibold, 'Myriad Pro Semibold' , 'Myriad Pro' , 'Trebuchet MS' , Tahoma, arial, sans-serif;
            font-size: 250%;
            margin: 0px;
            padding: 0px;
            margin-bottom: 20px;
            text-shadow: #ccc 1px 1px 0;
        }
    </style>
    <script type="text/javascript">
        var failureHandler = function (form, action) {
            Ext.Msg.show({
                title: '上传错误或者格式有误',
                msg: msg,
                buttons: Ext.Msg.OK,
                icon: Ext.Msg.ERROR
            });
        }

        var successHandler = function (form, action) {

            if (action.result) {
                Ext.MessageBox.alert('Error', '上传成功');
            }
            else {
                Ext.MessageBox.alert('Success', '上传错误或者格式有误');
            }


            Ext.Msg.show({
                title: '上传成功',
                msg: msg,
                buttons: Ext.Msg.OK
            });
        }
    </script>
</head>
<body>
    <ext:ResourceManager runat="server" />
    <ext:Viewport ID="ViewPort1" runat="server">
        <Items>
            <ext:RowLayout ID="RowLayout1" runat="server">
                <Rows>
                    <ext:LayoutRow RowHeight="0.3">
                        <ext:Panel ID="Panel1" runat="server">
                            <Content>
                                <div style="margin-left: 20px; margin-top: 20px">
                                    <h1>
                                        电影排片表上传</h1>
                                    <br />
                                    <ext:FormPanel ID="FormPanel1" runat="server" FileUpload="true" Method="POST" FormID="form1"
                                        Border="false" BodyBorder="false" HideLabel="true" HideLabels="true" BodyStyle="background:transparent;"
                                        Url='/Admin/UploadPlaytime.html'>
                                        <Items>
                                            <ext:FileUploadField ID="BasicField" runat="server" Width="400" Icon="Attach" />
                                        </Items>
                                    </ext:FormPanel>
                                    <ext:Button ID="Button1" runat="server" Text="上传" Icon="Accept">
                                        <DirectEvents>
                                            <Click Url="/Admin/UploadPlaytime.html" Timeout="60000" FormID="form1" CleanRequest="true"
                                                Method="POST" Success="Ext.Msg.show({title:   'Success',msg:     '上传成功',buttons: Ext.Msg.OK});#{EditPanel1}.load('/admin/PlaytimeEditPanel.html');"
                                                Failure="Ext.Msg.show({title:   'Error',msg:     '上传错误或者格式错误',buttons: Ext.Msg.OK});">
                                                <EventMask ShowMask="true" Msg="上传中..." />
                                            </Click>
                                        </DirectEvents>
                                    </ext:Button>
                                </div>
                            </Content>
                        </ext:Panel>
                    </ext:LayoutRow>
                    <ext:LayoutRow RowHeight="0.7">
                        <ext:Panel ID="EditPanel1" runat="server" AutoHeight="false">
                            <AutoLoad Mode="IFrame" ShowMask="true" MaskMsg="加载中..." />
                        </ext:Panel>
                    </ext:LayoutRow>
                </Rows>
            </ext:RowLayout>
        </Items>
    </ext:Viewport>
</body>
</html>
